home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
falcon
/
programm.ing
/
nt_dsp1.lzh
/
NT_DSP1.MSA
/
FNTNS
/
LOG2NRM.HLP
< prev
next >
Wrap
Text File
|
1989-01-24
|
700b
|
25 lines
Name: LOG2NRM.ASM
Type: Assembler Macro
Version: 1.0
Date Entered: 30-Mar-87
Last Change: 30-Mar-87
Description: Normalizing Base 2 Logarithm Macro
This program calculates the base 2 logarithm of an unnormalized
24 bit fraction "x" in register A and returns a scaled fraction
"y" in register A.
y = log2(x)/32.0 where 2**(-23) =< x < 1.0
-23/32 =< y < 0.0
Note - "x" must be a non-zero, positive fraction.
Three steps are required.
1. Normalize "x" so that 0.5 =< A < 1.0.
2. Calculate the log2(A).
3. Divide the result by 32.0
This macro uses a modified version of the log2 library macro.